package cn.yyh.serviceOrg.service.impl;

import cn.yyh.commons.service.impl.MyBaseServiceImpl;
import cn.yyh.commons.utils.BaseQuery;
import cn.yyh.commons.utils.PageInfo;
import cn.yyh.serviceOrg.entity.SystemDictionaryDetail;
import cn.yyh.serviceOrg.mapper.SystemDictionaryDetailMapper;
import cn.yyh.serviceOrg.service.SystemDictionaryDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yang
 * @since 2021-07-10
 */
@Service
public class SystemDictionaryDetailServiceImpl extends MyBaseServiceImpl<SystemDictionaryDetailMapper, SystemDictionaryDetail> implements SystemDictionaryDetailService {
    @Override
    public PageInfo<SystemDictionaryDetail> pageQuery(Long id, BaseQuery query) {
        Integer count = baseMapper.countByQuery(id, query);
        List<SystemDictionaryDetail> list = baseMapper.pageQuery(id, query);
        PageInfo<SystemDictionaryDetail> info = new PageInfo<>();
        info.setTotals(count);
        info.setRows(list);
        return info;
    }

    @Override
    public List<SystemDictionaryDetail> listDetails(Long id) {

        return baseMapper.listDetails(id);
    }
}
